<?
$total = $this->total;
$payments = $this->payments;
$dateFormat = 'Y-m-d H:i';
?>

<div class="content-box">

    <div class="content-box-header">
        <h3>Оплаты за сегодня</h3>
        <ul class="content-box-tabs">
            <li><a class="default-tab" href="#tab1">Таблица</a></li>
        </ul>
        <div class="clear"></div>
    </div>
    <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1">
            <form action="" method="post">
                <input type="text" name="dateStart" value="<?= $this->dateStart ?>" class="datepicker">-
                <input type="text" name="dateEnd" value="<?= $this->dateEnd ?>" class="datepicker">
                <input type="submit" value="Применить">
            </form>

            Всего покупок: <?= $total ?>.
            <table class="table table-striped">
                <thead>
                <tr>
                    <th>#</th>
                    <td>Описание</td>
                    <td>Время</td>
                    <td>Пользователеь</td>
                </tr>
                </thead>
                <tbody>
                <? foreach ($payments as $payment): ?>
                <tr>
                    <td><?= $payment['id'] ?></td>
                    <td><?= $this->escape($payment['description']); ?></td>
                    <td><?= $payment['createsAt']->format($dateFormat) ?></td>
                    <td>
                        <a href="/admin/user/view/id/<?= $payment['user']['id'] ?>">
                            <?= $this->escape($payment['user']['name']); ?>
                        </a>
                    </td>
                </tr>
                    <? endforeach; ?>
                </tbody>
            </table>
        </div>
    </div>
</div>